<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script>
			let names = ['James', 'Jacky', 'Curry', 'Jia Can'];
			
			function choujiang()
			{
				let index = parseInt(Math.random() * names.length);
				
				
				
				if(names.length != 0)
				{
					alert(names[index]);
					names.splice(index, 1);
				}
				else
				{
					alert('结束');
				}
			}
		</script>
	</head>
	<body>
		<button onclick="choujiang()">抽奖</button>
	</body>
</html>